import 'package:flutter/material.dart';
import 'dialog/alert_dialog.dart';
import 'dialog/simple_dialog.dart';
import 'dialog/model_bottom_sheet.dart';
// import 'package:fluttertoast/fluttertoast.dart';
import 'package:ftoast/ftoast.dart';
import 'dialog/my_dialog.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('default page')),
      body: Flex(
        direction: Axis.vertical,
        mainAxisAlignment: MainAxisAlignment.start,
        children: [
          const SizedBox(height: 10),
          ElevatedButton(
            onPressed: () {
              alertDialog(context);
            },
            child: const Text("AlertDialog"),
          ),
          const SizedBox(height: 10),
          ElevatedButton(
            onPressed: () {
              simpleDialog(context);
            },
            child: const Text("SimpleDialog"),
          ),
          const SizedBox(height: 10),
          ElevatedButton(
            onPressed: () {
              modelBottomSheet(context);
            },
            child: const Text("ModelBottomSheet"),
          ),
          // const SizedBox(height: 10),
          // ElevatedButton(
          //   onPressed: () {
          //     Fluttertoast.showToast(
          //         msg: "This is Center Short Toast",
          //         toastLength: Toast.LENGTH_SHORT,
          //         gravity: ToastGravity.CENTER,
          //         timeInSecForIosWeb: 1,
          //         backgroundColor: Colors.red,
          //         textColor: Colors.white,
          //         fontSize: 16.0
          //     );
          //   },
          //   child: const Text("Fluttertoast"),
          // ),
          const SizedBox(height: 10),
          ElevatedButton(
            onPressed: () {
              FToast.toast(
                context,
                msg: "This is Msg",
                subMsg: "Welcome to use FToast. This is subMsg!",
                subMsgStyle: const TextStyle(color: Colors.white, fontSize: 13),
              );
            },
            child: const Text("FToast"),
          ),
          const SizedBox(height: 10),
          ElevatedButton(
            onPressed: () {
              myDialog(context);
            },
            child: const Text("MyDialog"),
          )
        ],
      ),
    );
  }
}
